package top.hjcwzx.wrench.design.framework.service.link.prototype.logic;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import top.hjcwzx.wrench.design.framework.link.prototype.handler.ILogicHandler;
import top.hjcwzx.wrench.design.framework.model.link.prototype.LogicPrototypeReq;
import top.hjcwzx.wrench.design.framework.model.link.prototype.LogicPrototypeRes;
import top.hjcwzx.wrench.design.framework.service.link.prototype.factory.DefaultProtoTestRuleLogicFactory;

@Slf4j
@Service
public class TestPrototypeRuleLogic03 implements ILogicHandler<LogicPrototypeReq, DefaultProtoTestRuleLogicFactory.DynamicContext, LogicPrototypeRes> {
    @Override
    public LogicPrototypeRes apply(LogicPrototypeReq requestParameter, DefaultProtoTestRuleLogicFactory.DynamicContext dynamicContext) throws Exception {
        log.info("抽象多例链-链路03-执行链路逻辑-入参: {},上下文: {}", requestParameter, dynamicContext);
        String field = dynamicContext.getField();
        return LogicPrototypeRes.builder().result(true).resultStr(field).build();
    }
}
